﻿using System.Data;
using System.Runtime.Serialization;
using System.ServiceModel;
using System;

namespace HRMService
{
    // NOTE: If you change the interface name "IHeader" here, you must also update the reference to "IHeader" in App.config.
    [ServiceContract(Namespace = "http://HRMService")]
    public interface IHeader
    {
        [OperationContract]
        DataSet Header_GetAll();

        [OperationContract]
        int Header_Using(int HeaderID);
       
        [OperationContract]
        HeaderInfo Header_GetInfo(int HeaderID);

        [OperationContract]
        DataSet Header_GetList(out int ItemCount, int currentPage, int pageSize, string _BranchCode, int _Month, int _Year, string _Type);

        [OperationContract]
        int Header_Insert(HeaderInfo eInfo);

        [OperationContract]
        bool Header_Update(HeaderInfo eInfo);

        [OperationContract]
        bool Header_Delete(int HeaderID);

        [OperationContract]
        bool Header_DeleteByPeriod(string BrandCode, int Year, int Month, int Period, string Type);

        [OperationContract]
        int Header_GetPreDocumentPeroid(string BrandCode, int Year, int Month, int Period, string Type);

        [OperationContract]
        bool Header_Exist(int _ID, string BranchCode, DateTime _Date, string _SIBookNo, string _FromDate, string _ToDate, string _InsTypeCode);

        [OperationContract]
        bool Header_CheckExist(int _ID, string BranchCode, DateTime _Date, int _Month, int _Year, int _Period,string _Type);

        [OperationContract]
        HeaderInfo Header_GetMaxBymonth(int _Month, int _Year, string _BranchCode, string _Type);
    }

    [DataContract(Namespace = "http://HRMService")]
    public class HeaderInfo
    {
        int _ID;
        [DataMember]
        public int ID
        {
            get { return _ID; }
            set { _ID = value; }
        }
        string _BranhCode;
        [DataMember]
        public string BranhCode
        {
            get { return _BranhCode; }
            set { _BranhCode = value; }
        }
        DateTime _Date;
        [DataMember]
        public DateTime Date
        {
            get { return _Date; }
            set { _Date = value; }
        }
        int _Month;
        [DataMember]
        public int Month
        {
            get { return _Month; }
            set { _Month = value; }
        }
        int _Year;
        [DataMember]
        public int Year
        {
            get { return _Year; }
            set { _Year = value; }
        }
        int _Period;
        [DataMember]
        public int Period
        {
            get { return _Period; }
            set { _Period = value; }
        }
        decimal _Social;
        [DataMember]
        public decimal Social
        {
            get { return _Social; }
            set { _Social = value; }
        }
        decimal _Medical;
        [DataMember]
        public decimal Medical
        {
            get { return _Medical; }
            set { _Medical = value; }
        }
        decimal _Unemployed;
        [DataMember]
        public decimal Unemployed
        {
            get { return _Unemployed; }
            set { _Unemployed = value; }
        }
        decimal _BasicSalary;
        [DataMember]
        public decimal BasicSalary
        {
            get { return _BasicSalary; }
            set { _BasicSalary = value; }
        }
        bool _IsInitial;
        [DataMember]
        public bool IsInitial
        {
            get { return _IsInitial; }
            set { _IsInitial = value; }
        }
        string _Type;
        [DataMember]
        public string Type
        {
            get { return _Type; }
            set { _Type = value; }
        }
    }
}
